package com.taritari.journal.enums;

import lombok.Getter;

/**
 * @author taritari
 * @date 2024-01-08 22:35
 * @description 月份
 */
@Getter
public enum MonthEnum {
    JAN("01", "一月"),
    FEB("02","二月"),
    MAR("03", "三月"),
    APR("04", "四月"),
    MAY("05", "五月"),
    JUN("06", "六月"),
    JUL("07", "七月"),
    AUG("08", "八月"),
    SEP("09", "九月"),
    OCT("10", "十月"),
    NOV("11", "十一月"),
    DEC("12", "十二月");;
    /**
     * 月份
     */
    private String monthNum;

    /**
     * 对应月份
     */
    private String month;

    MonthEnum(String monthNum, String month) {
        this.monthNum = monthNum;
        this.month = month;
    }
    public static MonthEnum getByMonthNum(String monthNum) {
        for (MonthEnum monthEnum : MonthEnum.values()) {
            if (monthEnum.getMonthNum().equals(monthNum)) {
                return monthEnum;
            }
        }
        return null; // Handle if the monthNum is not found
    }
}
